	TITLE	'CLINE - SAVE COMMAND LINE IN INTERNAL BUFFER'
	PUBLIC	CLINE

	CSEG

;BX-->POINTS TO COMMAND LINE (USUALLY DS:0080H)
;EXIT WITH BX-->POINTING TO LINE IN HERE WITH NULL TERMINATOR

CLINE:	PUSH	SI
	PUSH	DI
	PUSH	ES
	MOV	SI,DS
	MOV	ES,SI
	PUSH	CX
	PUSHF
	CLD	
	MOV	CL,BYTE PTR 0 [BX]	;COUNT OF CHARS IN LINE
	MOV	CH,0
	LEA	SI,1[BX]	;GET START OF STRING
	MOV	DI,OFFSET THISBFR	;INTERNAL BUFFER
	MOV	BX,DI		;SET ADDRESS OF CLINE BUFFER
	REP MOVSB		;MOVE THE STRING TO HERE
	MOV	BYTE PTR [DI],0		;PUT TERMINATOR ON STRING
	POPF
	POP	CX
	POP	ES
	POP	DI
	POP	SI
	RET

	DSEG

THISBFR	RB	128		;CLINE BUFFER
	END
